﻿@{
    ViewBag.Title = "RoleEdit";
}
@model CRM.Admin.Contracts.Dto.Sys.RoleDto
@section head
{
    <script src="@Url.Content("~/ScriptPlugin/validate/validate.js")"></script>
    <link href="@Url.Content("~/ScriptPlugin/validate/validate.css")" rel="stylesheet" />
    <script type="text/javascript" src="@Url.Content("~/Scripts/form2json.js")"></script>
}
<form action="">
    <div class="content-form">
        <table class="content-table">
            <tr>
                <th><span>角色名称</span></th>
                <td>
                    <input type="text" value="@Model.Name" maxlength="80" data-validate-option="isNull" id="Name" name="Name" />
                </td>
                <th></th>
                <td>
                    @*<input type="hidden" value="@Model.OrganId" id="OrganId" name="OrganId" />
                    <input type="text" data-validate-option="isNull" value="@Model.Name" id="OrganName" name="OrganName" maxlength="80"
                           readonly="readonly" class="p-icon-right p-icon-business" onclick="getOrgan(this)" />*@
                </td>
            </tr>
            <tr>
                <th>排序号</th>
                <td><input type="text" value="@Model.Order" id="Order" name="Order" onkeypress="K.OnlyNum()" /></td>
                <th>是否锁定</th>
                <td>
                    <select id="IsLocked" name="IsLocked">
                        @if (Model.IsLocked == "否")
                        {
                            <option value="false" selected>否</option>
                        <option value="true">是</option>
                        }
                        else
                        {
                            <option value="false">否</option>
                        <option value="true" selected>是</option>
                        }
                    </select>
                </td>
            </tr>
            <tr>
                <th>是否管理员角色</th>
                <td>
                    <select id="IsAdmin" name="IsAdmin">
                        @if (Model.IsAdmin == "否")
                        {
                            <option value="false" selected>否</option>
                            <option value="true">是</option>
                        }
                        else
                        {
                            <option value="false">否</option>
                            <option value="true" selected>是</option>
                        }
                    </select>
                </td>
                <th>是否系统角色</th>
                <td>
                    <select id="IsSystem" name="IsSystem">
                        @if (Model.IsSystem == "否")
                        {
                            <option value="false" selected>否</option>
                            <option value="true">是</option>
                        }
                        else
                        {
                            <option value="false">否</option>
                            <option value="true" selected>是</option>
                        }
                    </select>
                </td>
            </tr>
            <tr>
                <th>备注</th>
                <td colspan="3">
                    <input type="text" value="@Model.Remark" maxlength="500" id="Remark" name="Remark" />
                    <input type="hidden" name="Id" id="Id" value="@Model.Id" />
                </td>
            </tr>
        </table>
    </div>
</form>
@section foot
{
    <script type="text/javascript">
       function SaveData(index) {
           if (K.Validate()) {
               var dto = KingsSharp.Form2Json();
               K.AjaxJson("@Url.Content("~/Sys/Role/RoleUpdate")", { dtos: dto }, function (result) {
                   parent.K.layer.callback(index, result, dto);
                   parent.K.layer.close(index);
               });
           }
       }
        @*function getOrgan(obj)
        {
            K.layer.iframe({
                title: "@Html.GetLayerTitle(LayerIcon.Details,"机构选择")",
                content: "@Url.Content("~/Sys/Organization/OrganizationTree")",
                maxmin: true,
                area:["360px","300px"],
                callback:function(node)
                {
                    $("#OrganName").val(node.name);
                    $("#OrganId").val(node.id);
                }
            });
        }*@
    </script>
}